<!--
 * @Author: hucc
 * @Date: 2021-10-08 16:39:39
 * @LastEditors: hucc
 * @LastEditTime: 2021-10-08 20:07:47
 * @Description: 
-->
<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>再见vue</title>
    <script src="https://cdn.bootcdn.net/ajax/libs/vue/2.6.13/vue.js"></script>
</head>

<body>
    <div id="app">
        <!-- 为false不显现 为true显现出来 -->
        <div v-if="isLogin">登陆成功，欢迎您！</div>
        <div v-else>请登录</div>
        <div>
            <button v-if='isLogin' @click="isLogin=false">退出</button>
            <button v-else @click="isLogin=true">登录</button>
        </div>
        <div>
            <button v-show='false' @click="isLogin=false">退出</button>
            <button v-show='true' @click="isLogin=true">登录</button>
        </div>
    </div>
    <script>
        let vm = new Vue({
            //当前vue实例的配置项
            el: '#app',
            data: {
                isLogin: false
            },
            methods: {
                findAllCategories() {
                    console.log('查询所有栏目信息')
                }
            },
            created() {
                this.findAllCategories();
            }
        })
    </script>
</body>

</html>